.class public final Lcn/cheln/explorer/util/SDcardCheck$MediaScannerBroadcast;
.super Landroid/content/BroadcastReceiver;


# static fields
.field public static a:Ljava/lang/String;


# instance fields
.field private b:Lcom/direction/hold/ui/CommonActivity;


# direct methods
.method public constructor <init>()V
    .locals 0

    invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V

    return-void
.end method


# virtual methods
.method public final a(Lcom/direction/hold/ui/CommonActivity;)V
    .locals 0

    iput-object p1, p0, Lcn/cheln/explorer/util/SDcardCheck$MediaScannerBroadcast;->b:Lcom/direction/hold/ui/CommonActivity;

    return-void
.end method

.method public final onReceive(Landroid/content/Context;Landroid/content/Intent;)V
    .locals 5

    const/4 v4, 0x1

    const/4 v3, 0x0

    const-string v0, "test"

    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "intent.getAction() -- "

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcn/cheln/support/app/c;->a(Ljava/lang/String;Ljava/lang/String;)V

    invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;

    move-result-object v0

    const-string v1, "android.intent.action.MEDIA_SCANNER_FINISHED"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_7

    const-string v0, "------------------ receive message 111"

    invoke-static {v0}, Lcn/cheln/support/app/c;->a(Ljava/lang/String;)V

    sget-object v0, Lcom/direction/hold/ui/CountActivity;->v:Lcom/direction/hold/ui/CountActivity;

    invoke-virtual {v0, v4}, Lcom/direction/hold/ui/CountActivity;->b(Z)V

    invoke-static {p1}, Lcn/cheln/explorer/ds/database/c;->a(Landroid/content/Context;)V

    sget-object v0, Lcom/direction/hold/ui/CountActivity;->v:Lcom/direction/hold/ui/CountActivity;

    if-eqz v0, :cond_0

    sget-object v0, Lcom/direction/hold/ui/CountActivity;->v:Lcom/direction/hold/ui/CountActivity;

    iget-object v0, v0, Lcom/direction/hold/ui/CountActivity;->a:Lcn/cheln/explorer/ds/a/d;

    invoke-virtual {v0}, Lcn/cheln/explorer/ds/a/d;->a()Z

    move-result v0

    if-eqz v0, :cond_3

    sget-object v0, Lcom/direction/hold/ui/CountActivity;->v:Lcom/direction/hold/ui/CountActivity;

    invoke-virtual {v0}, Lcom/direction/hold/ui/CountActivity;->C()Lcn/cheln/explorer/ui/b;

    move-result-object v0

    new-array v1, v3, [Ljava/lang/Object;

    invoke-virtual {v0, v1}, Lcn/cheln/explorer/ui/b;->a([Ljava/lang/Object;)V

    sget-object v0, Lcom/direction/hold/ui/CountActivity;->v:Lcom/direction/hold/ui/CountActivity;

    invoke-virtual {v0}, Lcom/direction/hold/ui/CountActivity;->C()Lcn/cheln/explorer/ui/b;

    move-result-object v0

    invoke-virtual {v0}, Lcn/cheln/explorer/ui/b;->c()V

    :cond_0
    :goto_0
    sget-boolean v0, Lcn/cheln/explorer/util/SDcardCheck;->b:Z

    if-eqz v0, :cond_4

    sget-object v0, Lcn/cheln/explorer/util/SDcardCheck$MediaScannerBroadcast;->a:Ljava/lang/String;

    if-eqz v0, :cond_1

    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const v1, 0x7f050075

    invoke-virtual {p1, v1}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    sget-object v1, Lcn/cheln/explorer/util/SDcardCheck$MediaScannerBroadcast;->a:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {p1, v0, v3}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;

    move-result-object v0

    invoke-virtual {v0}, Landroid/widget/Toast;->show()V

    :cond_1
    sput-boolean v3, Lcn/cheln/explorer/util/SDcardCheck;->b:Z

    const/4 v0, 0x0

    sput-object v0, Lcn/cheln/explorer/util/SDcardCheck$MediaScannerBroadcast;->a:Ljava/lang/String;

    :cond_2
    :goto_1
    return-void

    :cond_3
    sget-object v0, Lcom/direction/hold/ui/CountActivity;->v:Lcom/direction/hold/ui/CountActivity;

    invoke-virtual {v0}, Lcom/direction/hold/ui/FileCursorActivity;->v()V

    goto :goto_0

    :cond_4
    sget v0, Lcn/cheln/explorer/util/SDcardCheck;->a:I

    sub-int/2addr v0, v4

    sput v0, Lcn/cheln/explorer/util/SDcardCheck;->a:I

    if-nez v0, :cond_6

    sget-boolean v0, Lcn/cheln/explorer/actions/OperationUtil;->f:Z

    if-eqz v0, :cond_6

    new-instance v0, Landroid/os/Message;

    invoke-direct {v0}, Landroid/os/Message;-><init>()V

    iput v3, v0, Landroid/os/Message;->what:I

    sget-object v1, Lcn/cheln/explorer/actions/OperationUtil;->d:Landroid/app/ProgressDialog;

    iput-object v1, v0, Landroid/os/Message;->obj:Ljava/lang/Object;

    iget-object v1, p0, Lcn/cheln/explorer/util/SDcardCheck$MediaScannerBroadcast;->b:Lcom/direction/hold/ui/CommonActivity;

    iget-object v1, v1, Lcom/direction/hold/ui/CommonActivity;->i:Landroid/os/Handler;

    invoke-virtual {v1, v0}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z

    :cond_5
    :goto_2
    sget-object v0, Lcom/direction/hold/ui/CountActivity;->v:Lcom/direction/hold/ui/CountActivity;

    if-eqz v0, :cond_2

    sget-object v0, Lcom/direction/hold/ui/CountActivity;->v:Lcom/direction/hold/ui/CountActivity;

    invoke-virtual {v0}, Lcom/direction/hold/ui/CountActivity;->C()Lcn/cheln/explorer/ui/b;

    move-result-object v0

    invoke-virtual {v0}, Lcn/cheln/explorer/ui/b;->d()V

    goto :goto_1

    :cond_6
    sget v0, Lcn/cheln/explorer/util/SDcardCheck;->a:I

    if-gez v0, :cond_5

    sput v3, Lcn/cheln/explorer/util/SDcardCheck;->a:I

    goto :goto_2

    :cond_7
    invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;

    move-result-object v0

    const-string v1, "android.intent.action.MEDIA_UNMOUNTED"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_8

    invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;

    move-result-object v0

    const-string v1, "android.intent.action.MEDIA_REMOVED"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_8

    invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;

    move-result-object v0

    const-string v1, "android.intent.action.MEDIA_BAD_REMOVAL"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_8

    invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;

    move-result-object v0

    const-string v1, "android.intent.action.MEDIA_SHARED"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_8

    invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;

    move-result-object v0

    const-string v1, "android.intent.action.MEDIA_SCANNER_SCAN_FILE"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_9

    :cond_8
    sget-object v0, Lcom/direction/hold/ui/CountActivity;->v:Lcom/direction/hold/ui/CountActivity;

    invoke-static {v0}, Lcn/cheln/explorer/util/SDcardCheck;->a(Landroid/app/Activity;)Z

    sget-object v0, Lcom/direction/hold/ui/PathActivity;->v:Lcom/direction/hold/ui/PathActivity;

    invoke-static {v0}, Lcn/cheln/explorer/util/SDcardCheck;->a(Landroid/app/Activity;)Z

    goto :goto_1

    :cond_9
    invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;

    move-result-object v0

    const-string v1, "android.intent.action.MEDIA_MOUNTED"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_2

    sget-object v0, Lcom/direction/hold/ui/CountActivity;->v:Lcom/direction/hold/ui/CountActivity;

    iput-boolean v4, v0, Lcom/direction/hold/ui/CountActivity;->w:Z

    sget-object v0, Lcom/direction/hold/ui/CountActivity;->v:Lcom/direction/hold/ui/CountActivity;

    invoke-virtual {v0}, Lcom/direction/hold/ui/CountActivity;->E()V

    sput-boolean v3, Lcom/direction/hold/ui/PathActivity;->w:Z

    sget-object v0, Lcom/direction/hold/ui/PathActivity;->v:Lcom/direction/hold/ui/PathActivity;

    invoke-virtual {v0}, Lcom/direction/hold/ui/PathActivity;->C()V

    goto/16 :goto_1
.end method
